<template>
  <div>
    <el-form v-model="form" label-width="100px" label-suffix="">
      <edit-item label="单选" v-model="form.c21" type="radio" dictName="test1"/>
      <edit-item label="多选" v-model="form.c22" type="check" dictName="test2"/>
      <edit-item label="下拉" v-model="form.c3" type="select" multiple dictName="test3"/>
      <edit-item label="上传" v-model="form.c23" uploadUrl="/user/save/img" type="upload" />
      <edit-item label="图像" v-model="form.c24" uploadUrl="/user/save/img" type="img"  />
      <edit-item label="级联" v-model="form.c28" type="cascader" dictName="行政区划" multiple />
      <edit-item label="级联" v-model="form.c27" type="cascader" dictName="行政区划" />
      <edit-item label="地址" v-model="form.c26" type="addre" />
      <edit-item label="身份证" v-model="form.c13" type="sfzh" />
      <edit-item label="邮箱" v-model="form.c13" type="email" />
      <hr/>
      <edit-item label="单选" v-model="form.c21" type="radio" dictName="test1" readonly/>
      <edit-item label="多选" v-model="form.c22" type="check" dictName="test2" readonly/>
      <edit-item label="下拉" v-model="form.c3" type="select" multiple dictName="test3" readonly/>
      <edit-item label="上传" v-model="form.c23" uploadUrl="/user/save/img" readonly type="upload" />
      <edit-item label="图像" v-model="form.c24" uploadUrl="/user/save/img" readonly type="img"  />
      <edit-item label="级联" v-model="form.c28" type="cascader" dictName="行政区划" multiple readonly />
      <edit-item label="级联" v-model="form.c27" type="cascader" dictName="行政区划" readonly />
      <edit-item label="地址" v-model="form.c26" type="addre" readonly  />
      <hr/>
      <hr/>
      <edit-item label="文本" v-model="form.c1" type="text" />
      <edit-item label="密码" v-model="form.c2" type="password" />
      <edit-item label="数字" v-model="form.c3" type="number" />
      <edit-item label="滑块" v-model="form.c4" type="slider"  range/>
      <edit-item label="评价" v-model="form.c6" type="rate" />
      <edit-item label="颜色" v-model="form.c7" type="color" />
      <edit-item label="时间" v-model="form.c8" type="time" />
      <edit-item label="时间段" v-model="form.c9" type="time" range />
      <edit-item label="日期" v-model="form.c8" type="date" />
      <edit-item label="日期段" v-model="form.c8" type="date" range />
      <edit-item label="年" v-model="form.c8" type="year" />
      <edit-item label="月" v-model="form.c8" type="month" />
      <edit-item label="月段" v-model="form.c9" type="month" range />
      <edit-item label="周" v-model="form.c8" type="week" />
      <hr/>
      <edit-item label="文本" v-model="form.c1" type="text" readonly />
      <edit-item label="密码" v-model="form.c2" type="password" readonly />
      <edit-item label="数字" v-model="form.c3" type="number" readonly />
      <edit-item label="滑块" v-model="form.c4" type="slider" readonly  range/>
      <edit-item label="评价" v-model="form.c6" type="rate" readonly />
      <edit-item label="颜色" v-model="form.c7" type="color" readonly />
      <edit-item label="时间" v-model="form.c8" type="time" readonly />
      <edit-item label="时间段" v-model="form.c9" type="time" readonly range />
      <edit-item label="日期" v-model="form.c8" type="date" readonly />
      <edit-item label="日期段" v-model="form.c8" type="date" readonly range />
      <edit-item label="年" v-model="form.c8" type="year" readonly />
      <edit-item label="月" v-model="form.c8" type="month" readonly />
      <edit-item label="月段" v-model="form.c9" type="month" readonly range />
      <edit-item label="周" v-model="form.c8" type="week" readonly />
    </el-form>
    <el-button @click="testBtn">test</el-button>
  </div>
</template>

<script>
import EditItem from '@comp/form/EditItem.vue'
export default {
  components:{EditItem},
  data(){
    return {
      form:{
        c1:'aaa',
        c2:'12321',
        c3:[1,3,5],
        c4:35,
        c5:true,
        c6:2,
        c7:'',
        c8:'',
        c9: [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
        c10:[],
        c11:{code:'',addre:''},
        c12:[],
        c13:'',
        c21:1,
        c22:[2,4],
        c23:[{name:'fdafds.jpg',url:'/api/download/fdafd.jpg'},{name:'fda12321fds.jpg',url:'/api/download/fda321321fd.jpg'}],
        c24:{},
        c25:['150302','150303'],
        c26:{code:'150303',addre:'测试'},
        c28:['150302','150303'],
        c27:'150302'
      }
    }
  },
  methods:{
    async testBtn(){
      console.log(await this.$dict.getList('test1'))
    }
  }
}
</script>